<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" >
    <title>兑换中心</title>
    <link rel="icon" href="favicon.ico" type="images/ico">
    <meta name="author" content="dc">
    <link rel="stylesheet" type="text/css" href="/css/materialdesignicons.min.css">
    <link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/css/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/css/style.min.css">
    <link rel="stylesheet" href="/css/viewer.css">
    <link href="/js/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />
    <!--固定table列-->
    <link href="/js/bootstrap-table/extensions/fixed-columns/bootstrap-table-fixed-columns.min.css" rel="stylesheet"/>

    <link rel="stylesheet" href="/js/jquery-confirm/jquery-confirm.min.css" />
    <link rel="stylesheet" href="/css/input_tags.css"/>
    <!--时间选择插件-->
    <link rel="stylesheet" href="/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css">
    <!--日期选择插件-->
    <link rel="stylesheet" href="/js/bootstrap-datepicker/bootstrap-datepicker3.min.css">
    <link rel="stylesheet" href="/js/need/verfont.css" />
    <!-- 多选下拉 -->
    <link rel="stylesheet" href="/css/bootstrap-multiselect.css" type="text/css"/>
    <link rel="stylesheet" href="/css/bootstrap-select.css" type="text/css"/>
    <!--表单校验插件-->
    <link rel="stylesheet" href="/css/bootstrapValidator.min.css" />

    <link rel="stylesheet" href="/css/skin.css"/>
    <link rel="stylesheet" href="/css/csd/customerManager/productExchange.css" type="text/css"/>
    <link rel="stylesheet" href="/css/csd/customerManager/exchangeCenter.css" type="text/css"/>
</head>
<body>
<div class="container-fluid" id="productExchange">
    <div class="card">
        <div class="card-header">
            <h1>兑换中心</h1>
        </div>
        <div>
            <ul class="new-tabs">
                <!-- 兑换明细  兑换规则设置-->
                <input type="hidden" id="exchangeType" name="dateType"/>
                <li class="nav-item active" style="margin-left:24px">
                    <a href="#productExchangeTab" data-toggle="tab"  id="exchangeInspect" onclick="changeTab('product')">产品兑换</a>
                </li>
                <li class="nav-item">
                    <a href="#exchangeDetail" data-toggle="tab"  id="exchangeRule" onclick="changeTab('member')">会员权益兑换</a>
                </li>
            </ul>
            <main class="tab-content">
                <div role="tabpanel" id="productExchangeTab" class="tab-pane active clearFix">
                    <div class="clearFix" style="width:100%">
                        <form class="form-horizontal pull-left" id="productExchangeForm" style="width:100%;padding-bottom:10px">
                            <div class="row form-group clearFix" style="margin-left: 50%; width: 380px;transform: translateX(-50%)">
                                <label class="control-label label-required pull-left" id="orderNumberTitle" style="line-height:21px;margin-right:10px">订单编号:</label>
                                <div class="form-content clearFix">
                                    <div class="min-search pull-left">
                                        <input class="form-control" type="text" placeholder="请输入订单编号"
                                               id="orderNumber" name="orderNumber">
                                        <button class="btn btn-primary" type="button" style="height:36px" onclick="searchOrder()">
                                            <i class="mdi mdi-magnify"></i><span>搜索</span>
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div id="productList" style="display:none;width:100%;border-top:1px solid #F0F4F8;margin-top:10px">
                        <div class="card-body">
                            <h4 style="margin-top:10px">
                                <span>当前订单编号:</span>
                                <span id="orderNumberCon">
                                <span id="orderNumberText"></span>
                            </span>
                            </h4>
                            <div class="modules">
                                <header>选择产品兑换</header>
                                <table id="productExchangeSource"></table>
                            </div>
                        </div>
                        <div class="card-body">
                            <div class="modules">
                                <header>添加要兑换的产品</header>
                                <div class="clearFix">
                                    <div id="productActivityTableToolbar" class="toolbar pull-right" style="margin-bottom:20px">
                                        <button type="button" class="btn btn-success btn-label" data-toggle="modal" onclick="openAddProductModal()"><label><i class="mdi mdi-plus"></i></label>添加产品</button>
                                    </div>
                                </div>
                                <table id="productExchangeTarget"></table>
                            </div>
                        </div>
                        <div class="card-body clearFix">
                            <div class="row content-action clearFix">
                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                                    <div class="modules">
                                        <header class="label-required">兑换原因</header>
                                        <form id="exchangeReasonForm">
                                            <div class="form-group" style="margin-bottom:5px">
                                                <div class="form-content">
                                                    <textarea class="form-control" id="reason" name="reason" placeholder="请输入兑换原因(不少于30字)" rows="8"></textarea>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                                    <div class="modules">
                                        <header>上传审批附件</header>
                                        <div>
                                            <label for="importInput" id='importTemplate'>
                                                <!--<div class="file-box" style="width:calc(100% - 50px);margin-left:6px">
                                                    <input type="hidden" id="exchangeContractPic" class="image-id" >
                                                    <input type="file" accept=".doc,.pdf,.docx" id="exchangeContractImg" name="exchangeContractImg" class="form-control"  onchange="uploadImgExchange()">
                                                </div>-->
                                                <input type="hidden" id="exchangeContractPic" class="image-id" >
                                                <input type="file" accept=".doc,.pdf,.docx" id="importInput" class="hide" onchange="uploadImg()">
                                                <i class="mdi mdi-cloud-upload"></i>
                                                <p id="nameText">
                                                    <span><i class="mdi mdi-arrow-up-bold-box-outline"></i>上传文件</span>
                                                </p>
                                                <p id="tipText">
                                                    <span>支持文件格式:jpg、zip、docx、doc、pdf...</span>
                                                </p>
                                            </label>
                                        </div>
                                    </div>

                                </div>

                            </div>

                        </div>
                        <div id="productExchangeBtn">
                            <button type="button" class="btn btn-default" onclick="cancel()">取消</button>
                            <button type="button" class="btn btn-primary" onclick="submitExamine()">提交审核</button>
                        </div>
                    </div>


                </div>
                <div role="tabpanel" id="exchangeDetail" class="tab-pane">
                    <div class="card-body">
                        <div class="warning">
                            <span class="warnTitle">说明:</span>
                            <!--<span class="warnText">兑换码需在客户详情页下的产品明细兑换产品列表生成!</span>-->
                            <span class="warnText">请去'客户详情-产品明细-兑换产品-详细信息'申请兑换码</span>
                        </div>
                    </div>
                    <!--兑换中心-->
                    <div class="card-body row content-action">
                        <div class="col-lg-7 col-md-6 col-sm-6 col-xs-12">
                            <!-- 全部 本周 本月 上月 自定义-->
                            <div class="time-search pull-left">
                                <input type="hidden" id="dateType" name="dateType"/>
                                <div id="all" class="timeBtn active-second" onclick="selectTime('all')">全部</div>
                                <div id="customize" class="timeBtn" onclick="selectTime('customize')">自定义</div>
                            </div>
                            <div class="custom-input pull-left" id="customInput" style="margin-left: 10px;width: 410px;">
                                <div class="input-group">
                                    <input type="text" class="form-control datepicker" placeholder="请选择兑换时间" id="arriveTimeStart">
                                    <span class="input-group-addon">至</span>
                                    <input type="text" class="form-control datepicker" placeholder="请选择兑换时间" id="arriveTimeEnd">
                                    <div class="input-group-btn">
                                        <button type="button" class="btn btn-default" id="customDateBtn" onClick="exchangeDetailsList()">确定</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-5 col-md-6 col-sm-6 col-xs-12">
                            <div class="pull-right">
                                <!--<div class="selectContainer">
                                    <select id="ruleSelect" title="选择规则编码"  name="ruleSelect" class="form-control selectpicker" data-live-search="true">
                                        <option value="">请选择规则编码</option>
                                    </select>
                                </div>-->
                                <div class="min-search pull-left">
                                    <input class="form-control" type="text" placeholder="请输入客户名称" id="customerName" name="customerName">
                                    <button class="btn btn-primary" type="button" onclick="exchangeDetailsList()"><i class="mdi mdi-magnify"></i><span>搜索</span></button>
                                </div>
                                <!--<button style="margin-left:12px;" class="btn btn-primary" onClick="exchangeDetailsList()" type="button">搜索</button>-->
                                <div id="advanceFilterContainer">
                                    <button class="btn btn-default btn-senior" id="openFilter" onClick="showToggle()"><i class="mdi mdi-sort-variant"></i>高级筛选</button>
                                    <button class="btn btn-default btn-senior" id="closeFilter" onClick="showToggle()"><i class="mdi mdi-close"></i>关闭筛选</button>
                                    <div id="filterFilesContainer" class="clearFix">
                                        <div id="filterFiles" class="clearFix">
                                            <!--                                    <i class="trangle"></i>-->
                                            <h4>高级筛选</h4>
                                            <div class="clearFix filterContent">
                                                <div>


                                                </div>
                                                <div id="btnsContainerDetail" class="clearFix">
                                                    <button class="btn btn-default" id="btn-reset">重置</button>
                                                    <button class="btn btn-primary" type="button" id="btn-search" onClick="exchangeDetailsList()">
                                                        <i class="mdi mdi-magnify"></i><span>搜索</span>
                                                    </button>
                                                </div>
                                            </div>
                                        </div>

                                    </div>
                                </div>

                            </div>
                        </div>
                        <div class="productDetailsFormCon">
                            <table id="exchangeDetailsTable"></table>
                        </div>
                    </div>
                </div>
            </main>
        </div>
    </div>
</div>
<!--审批结果-->
<div class="modal fade" tabindex="-1" role="dialog" id="exchangeDetailModal">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                <h4>审批结果</h4>
            </div>
            <div class="modal-body" style="min-height: 200px;">
                <main id="exchangeApproval" class="clearFix">
                    <form class="form-horizontal clearFix" style="padding:0 20px;">
                        <div class="form-group clearFix col-lg-4 col-md-4 col-sm-4 col-xs-12">
                            <label class="control-label pull-left">审批人:</label>
                            <div class="form-content">
                                <span id="approverName" style="line-height: 35px;"></span>
                            </div>
                        </div>
                        <div class="form-group clearFix col-lg-4 col-md-4 col-sm-4 col-xs-12">
                            <label class="control-label pull-left">审批时间:</label>
                            <div class="form-content">
                                <span id="updateTm" style="line-height: 35px;"></span>
                            </div>
                        </div>
                        <div class="form-group clearFix col-lg-4 col-md-4 col-sm-4 col-xs-12">
                            <label class="control-label pull-left">相关附件:</label>
                            <div class="form-content">
                                <a href="javascript:;" style="line-height:36px;margin-left:5px;" onclick="showFile(1);">查看</a>
                            </div>
                        </div>
                        <div class="form-group clearFix col-lg-12 col-md-12 col-sm-12 col-xs-12">
                            <label class="control-label pull-left">备注:</label>
                            <div class="form-content">
                                <textarea class="form-control" readonly id="remarks" rows="3" style="width:calc(100% + 25px);resize: none"></textarea>
                            </div>
                        </div>
                    </form>
                </main>
            </div>
        </div>
    </div>
</div>
<!-- 附件预览 -->
<div class="modal fade bs-example-modal-lg fileModal" tabindex="-1" role="dialog" id="fileModal">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                <h4>附件预览</h4>
            </div>
            <div class="modal-body">
                <iframe src="" frameborder="0" id="fileIframe"></iframe>
            </div>
        </div>
    </div>
</div>
<!-- 添加产品 弹窗 -->
<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" id="addProductModal">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                <h4 id="modalTitle">添加产品</h4>
            </div>
            <div class="modal-body clearFix">
                <!--<form class="form-horizontal pull-left" id="producePriceForm" style="width:100%">
                    <div class="row form-group clearFix" style="margin:0">
                        <label class="control-label label-required pull-left" id="priceTitle" style="line-height:21px;margin-right:10px">价格:</label>
                        <div class="form-content clearFix">
                            <div class="min-search pull-left">
                                <input class="form-control" type="text" placeholder="请输入价格" id="price" name="price">
                            </div>
                        </div>
                    </div>
                </form>-->
                <ul class="new-tabs">
                    <li class="nav-item active" style="margin-left:24px">
                        <a href="#memberProduct" data-toggle="tab"  id="memberProductTab">会员产品</a>
                    </li>
                    <li class="nav-item">
                        <a href="#noMemberProduct" data-toggle="tab"  id="noMemberProductTab">非会员产品</a>
                    </li>
                </ul>
                <main class="tab-content">
                    <div role="tabpanel" id="memberProduct" class="tab-pane active clearFix">
                            <table id="memberProductTable"></table>
                    </div>
                    <div role="tabpanel" id="noMemberProduct" class="tab-pane clearFix">
                            <table id="noMemberProductTable"></table>
                    </div>
                </main>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" onclick="addProduct()">确定</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
</body>

<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="/js/main.min.js"></script>
<!---->
<script type="text/javascript" src="/js/popper.min.js"></script>
<script type="text/javascript" src="/js/jquery.cookie.min.js"></script>
<script src="/js/crm/common/input-tag.js"></script>
<script src="/js/crm/common/city.js"></script>
<script src="/js/crm/common/common.js"></script>
<!--时间选择插件-->
<script src="/js/bootstrap-datetimepicker/moment.min.js"></script>
<script src="/js/jquery-confirm/jquery-confirm.min.js"></script>
<script src="/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script src="/js/bootstrap-datetimepicker/locale/zh-cn.js"></script>
<!--日期选择插件-->
<script src="/js/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
<script src="/js/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
<script type="text/javascript" src="/js/crm/common/dataRangePicker.min.js"></script>
<script src="/js/verSelect.2.0.js"></script>
<!--图片查看-->
<script type="text/javascript" src="/js/viewer.js"></script>
<script type="text/javascript" src="/js/jquery-viewer.js"></script>
<!--表单校验-->
<script type="text/javascript" src="/js/bootstrapValidator.min.js"></script>
<!-- 多选框下拉 -->
<script type="text/javascript" src="/js/bootstrap-multiselect.js"></script>
<script type="text/javascript" src="/js/bootstrap-select.js"></script>
<script type="text/javascript" src="/js/bootstrap.lyear.dropdowntree.min.js"></script>
<!-- 子页面公用js -->
<script src="/js/crm/common/pageCommon.js"></script>
<script src="/js/crm/customerManager/user/exchangeCenterCommon.js"></script>
</html>
